package com.zmytest.one2many;

import com.zmytest.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import java.util.List;

/**
 * Created on 2018/12/24.
 *
 * @author zhangmingyu
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
public class Owner extends BaseModel<Integer> {

    private String name;

    @OneToMany
    @JoinColumn(name = "ownerId")
    private List<Car> cars;
}